package org.ccay.enumerable.popular;

import org.ccay.enumerable.EnumI18nUtil;
import org.ccay.enumerable.EnumItem;
import org.ccay.enumerable.EnumUtil;
import org.ccay.enumerable.SourceEnum;

public enum WeekEnum implements EnumItem<WeekEnum>{
	Sunday("0","星期日"),
	Monday("1","星期一"),
	Tuesday("2","星期二"),
	Wednesday("3","星期三"),
	Thursday("4","星期四"),
	Friday("5","星期五"),
	Saturday("6","星期六");
	
	private String value;
	private String displayValue;

	private WeekEnum(String value, String displayValue){
		this.value = value;
		this.displayValue = displayValue;
	}
	
	@Override
	public String getType() {
		return this.getClass().getSimpleName();
	}

	@Override
	public int getIndex() {
		return ordinal();
	}

	@Override
	public String getName() {
		return this.name();
	}

	@Override
	public String getValue() {
		return value;
	}

	@Override
	public String getDisplayValue() {
		return displayValue;
	}

	@Override
	public String getSource() {
		return SourceEnum.SOURCE_JAVA.getValue();
	}

	@Override
	public String getDisplayValue(String language) {
		return EnumI18nUtil.getI18nName(this, language);
	}
	public EnumItem<WeekEnum> fromValue(String value) {
		return EnumUtil.getInstance().getByTypeValue(getType(),  getValue());
	}
}
